package logic.game;

/**
 * Abstract class responsible for representing physical entities in the {@link GameField}
 * @author Peter Zastoupil, peterzastoupil@gmail.com
 *
 */
public abstract class PhysicalObject extends GameObject {
	
	/**
	 * Represents the elasticity, or "bounciness," of a PhysicalObject 
	 * when colliding with another PhysicalObject
	 */
	int elasticity;
	
	/**
	 * Represents the degree of rotation of the PhysicalObject with respect 
	 * to the native coordinate system, in degrees
	 */
	double rotation;
	
	/**
	 * Sets the elasticity of the PhysicalObject
	 * @param elasticity is the new elasticity of the PhysicalObject
	 */
	void setElasticity(int elasticity){
		this.elasticity = elasticity;
	}
	
	/**
	 * Returns the elasticity of the PhysicalObject
	 * @return the elasticity of the PhysicalObject
	 */
	int getElasticity(){
		return this.elasticity;
	}
	
	/**
	 * Sets the rotation of the PhysicalObject
	 * @param rotation is the rotation of the PhysicalObject in degrees
	 */
	void setRotation(double rotation){
		this.rotation = rotation;
	}
	
	/**
	 * Returns the current rotation of the PhysicalObject
	 * @return the current rotation of the PhysicalObject
	 */
	double getRotation(){
		return this.rotation;
	}
	
	/**
	 * Models the collision between this PhysicalObject and another
	 * @param physicalObject is the object with which this one is to collide
	 */
	abstract void collideWith(PhysicalObject physicalObject);

}
